package com.joe.codemother.entity.enums;

import lombok.Getter;

@Getter
public enum GenerateTypeEnum {

    HTML("HTML generate type","html"),
    MULTI_FILE("Multi-file generate type","multifile");

    private final String text;

    private final String value;

    GenerateTypeEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public static GenerateTypeEnum getTypeByValue(String value) {
        if(value == null){
            return null;
        }
        for (GenerateTypeEnum generateTypeEnum : GenerateTypeEnum.values()) {
            if (generateTypeEnum.value.equals(value)) {
                return generateTypeEnum;
            }
        }
        return null;
    }
}
